package com.atguigu.exam;

import java.io.*;
import java.util.Scanner;

/**
 * 编写一个应用程序，将用户从键盘输入的10个整数存入文件，再顺序读出。
 * @author xbd
 * @create 2021-05-30 22:45
 */
public class IntTest {
    public static void main(String[] args) throws IOException {
        BufferedWriter bw=new BufferedWriter(new FileWriter(new File("6.txt")));

        Scanner sc =new Scanner(System.in);
        for(int i=0;i<10;i++) {
            bw.write(sc.nextInt()+"\n");
        }
        bw.close();
        BufferedReader br=new BufferedReader(new FileReader(new File("6.txt")));
        for(int i=0;i<10;i++) {
            System.out.println(br.readLine());
        }
        br.close();
        sc.close();
    }
}
